Page({
  data: {
    show1: false,
    show2: false, // 添加 show2 字段
    selectedOption1: '国家一级心理咨询师',
    selectedOption2: '压力情绪',
    date: '',
    show: false,
  },

  showPopup1() {
    this.setData({ show1: true });
  },

  showPopup2() {
    this.setData({ show2: true });
  },

  onClose1() {
    this.setData({ show1: false });
  },

  onClose2() {
    this.setData({ show2: false });
  },

  onClose() {
    this.setData({ show: false });
  },
  formatDate(date) {
    date = new Date(date);
    return `${date.getMonth() + 1}/${date.getDate()}`;
  },
  onConfirm(event) {
    this.setData({
      show: false,
      date: this.formatDate(event.detail),
    });
  },

  onDisplay() {
    this.setData({ show: true });
  },

  onOptionChange(event) {
    this.setData({ 
      selectedOption: event.detail
    });
    this.setData({ 
      show1: false,
      show2: false, // 在选项更改时关闭两个弹出层
      show3: false // 在选项更改时关闭两个弹出层
    });
	},
	goBack(){
		wx.navigateBack();
	}
});